@use 'sass:math';

@import '../functions/_ddivide';

@mixin responsiveRatio($x, $y, $pseudo: false) {
  $padding: (ddivide(math.div($y, $x))) * 100 + '%';

  @if $pseudo {
    &:before {
      @include pseudo($pos: relative);
      width: 100%;
      padding-top: $padding;
    }
  } @else {
    padding-top: $padding;
  }
}
